package vote

import (
	models "HeadLineNews/proto_models/app/vote_model"
	"HeadLineNews/utils"
	"github.com/gin-gonic/gin"
)

type Ctx interface {
	ParseParamUserVote(c *gin.Context) (p *models.RequestUserVote, err error)
}

type ctx struct {
}

func NewCtx() Ctx {
	return &ctx{}
}

// ParseParamUserVote 解析用户的点赞参数
func (ctx *ctx) ParseParamUserVote(c *gin.Context) (p *models.RequestUserVote, err error) {
	p = new(models.RequestUserVote)
	err = utils.ShouldBindProtobuf(c, p)
	return
}